# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from . import MusicDownloader


class QqmusicPipeline(object):
    def process_item(self, item, spider):
        #保存歌曲
        print(item)
        songlist=item["cdlist"][0]["songlist"]
        for song in songlist:
            MusicDownloader.MusicDownloader.downloadMusic(song["songmid"])
        return item
